package com.weijianhuawen.wjblog.web.controller;

import com.weijianhuawen.wjblog.common.aspect.ApiOperationLog;
import com.weijianhuawen.wjblog.common.utils.Response;
import com.weijianhuawen.wjblog.web.mode.vo.comment.FindCommentListReqVo;
import com.weijianhuawen.wjblog.web.mode.vo.comment.FindQQUserInfoReqVo;
import com.weijianhuawen.wjblog.web.mode.vo.comment.PublishCommentReqVo;
import com.weijianhuawen.wjblog.web.service.CommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version: java version 8
 * @Author: weijianhuawen
 * @description:
 * @date: 2024-12-08 16:13
 */
@RestController
@RequestMapping("/comment")
@Api(tags = "前台评论模块")
public class CommentController {
    @Autowired
    private CommentService commentService;

    // 根据qq号获取基本信息
    @PostMapping("/qq/info")
    @ApiOperation(value = "通过qq号获取qq基本信息")
    @ApiOperationLog(description = "通过qq号获取qq用户的基本信息")
    public Response findQQUserInfo(@RequestBody @Validated FindQQUserInfoReqVo vo) {
        return commentService.findQQUserInfo(vo);
    }

    // 获取页面评论列表
    @PostMapping("/list")
    @ApiOperation(value = "获取页面评论列表")
    @ApiOperationLog(description = "获取页面所有评论")
    public Response findCommentList(@RequestBody @Validated FindCommentListReqVo vo) {
        return commentService.findCommentList(vo);
    }
}
